// 引入mongoose模块
const mongoose = require('mongoose');

//创建文档的结构对象（Schema）
let BooksSchema = new mongoose.Schema({
    name: String,
    author: String,
    price: Number,
});

//创建Model对象, 将Schema发布为Model
let BookModel = mongoose.model('books', BooksSchema);

//暴露Model对象
module.exports = BookModel;
